﻿(function ($) {
    $.maix = {
        init: function () {
            $.maix.inits();
            $.maix.saveLogs();
        },
        inits: function () {

        },
        saveLogs: function () {
            var absoluteUri = window.location.href;
            var host = window.location.host;
            var queryString = window.location.search;

            var url = createLogVisitorRecordUrl("save");
            var data = {
                host: host,
                absolute_uri: absoluteUri,
                query_string: queryString
            };
            $.ajax({
                url: url,
                type: "POST",
                cache: false,
                data: JSON.stringify(data),
                contentType: "application/json",
                dataType: "json",
                error: function (XMLHttpRequest, textStatus, errorThrown) {

                },
                success: function (res) {
                    console.log(res);
                    var code = res.code;
                    var msg = res.message;
                    if (code == 0) {

                    }
                }
            });
        }
    };
    $(function () {
        $.maix.init();
    });
})(jQuery);